﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<RhombusWebMVC.Models.WorkItemViewModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Edit
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

<h2>Edit</h2>

<script src="<%: Url.Content("~/Scripts/jquery.validate.min.js") %>" type="text/javascript"></script>
<script src="<%: Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js") %>" type="text/javascript"></script>

<% using (Html.BeginForm()) { %>
	<%: Html.ValidationSummary(true) %>
	<fieldset>
		
		<%= Html.EditorForModel() %>

		<table>
			<thead>
				<tr>
					<th>Text</th>
					<th>Date</th>
					<th>User</th>
				</tr>
			</thead>
			<tbody>
			<% foreach (var item in Model.History)
			{ %>
				
				<tr>
					<td><%= Html.Encode(item.Text) %></td>
					<td><%= Html.Encode(item.CreatedDate) %></td>
					<td><%= Html.Encode(item.CreatedByUser) %></td>
				</tr>

			<% } %>
			</tbody>
		</table>

		<p>
			<input type="submit" value="Save" />
		</p>
	</fieldset>
<% } %>

<div>
	<%: Html.ActionLink("Back to List", "Index") %>
</div>

</asp:Content>

